<script setup>
// v-model 默认的是 v-model:modelValue="xxxx"
defineProps({
  modelValue: Boolean,
  title: Number,
});
const emit = defineEmits(["update:modelValue", "update:title"]);
const close = () => {
  emit("update:modelValue", false); // 关闭dialog
  emit("update:title", 0); // 设置count为0
};
</script>
<template>
  <el-dialog v-model="modelValue" title="Tips" width="500" :before-close="handleClose">
    <span>{{ title }}</span>
    <template #footer>
      <div class="dialog-footer">
        <!-- 点击取消 -->
        <!-- 关闭dialog -->
        <!-- 设置count为0 -->
        <el-button @click="close">Cancel</el-button>
        <el-button type="primary" @click="emit('update:title', 0)"> Confirm </el-button>
      </div>
    </template>
  </el-dialog>
</template>
